package com.mymail.myutil;

import com.mymail.entity.Mail;
import com.mymail.entity.User;

public class DeleteMail {
	public static void main(String[] args) {
		delete1("1;34;23", null);
	}
	private static String changeString(String str,User user){
		String[] s = str.split(";");
		str = "";
		for (int i = 0; i < s.length; ++i) {
			str += user.getMail(Integer.parseInt(s[i])).getId() + ";";
		}
		str = str.substring(0, str.length() - 1);
		return str;
	}
	
	public static boolean delete1(String str, User user) {
		return Mail.getDAO().delete1(changeString(str,user), user.getId());
	}
	public static boolean delete2(String str,User user){
		return Mail.getDAO().delete2(changeString(str,user), user.getId());
	}

}
